from App.ext import db


class User(db.Model):

    __tablename__ = 'user'

    #
    u_id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    username = db.Column(db.String(50), unique=True, nullable=False)
    password = db.Column(db.String(50), nullable=False)


class ScenicSpot(db.Model):

    __tablename__ = 't_scenic_spot'

    s_id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    s_name = db.Column(db.String(100), unique=True, nullable=False)
    s_level = db.Column(db.Integer, nullable=False)
    s_area = db.Column(db.String(100))
    s_PV = db.Column(db.Integer)
    s_LN = db.Column(db.Integer)
    s_path = db.Column(db.String(100))
    s_img = db.Column(db.BLOB)
    s_detail = db.Column(db.String(5000))


class Comment(db.Model):

    __tablename__ = 't_comment'

    s_id = db.Column(db.Integer, primary_key=True)
    c_comment = db.Column(db.String(250), primary_key=True)